home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / ghost / gs403src_amiga.lha / gs4.03 / gs.mak.in < prev    next >
Text File  |  1997-03-16  |  13KB  |  304 lines

  1. #    Copyright (C) 1989, 1996 Aladdin Enterprises.  All rights reserved.
  2. # This file is part of Aladdin Ghostscript.
  3. # Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. # or distributor accepts any responsibility for the consequences of using it,
  5. # or for whether it serves any particular purpose or works at all, unless he
  6. # or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. # License (the "License") for full details.
  8. # Every copy of Aladdin Ghostscript must include a copy of the License,
  9. # normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. # the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. # under certain conditions described in the License.  Among other things, the
  12. # License requires that the copyright notice and this notice be preserved on
  13. # all copies.
  14.  
  15. # Generic makefile, common to all platforms.
  16. # The platform-specific makefiles `include' this file.
  17. # They define the following symbols:
  18. #    GS - the name of the executable (without the extension, if any).
  19. #    GS_LIB_DEFAULT - the default directory/ies for searching for the
  20. #        initialization and font files at run time.
  21. #    GS_DOCDIR - the directory where documentation will be available
  22. #        at run time.
  23. #    JSRCDIR - the directory where the IJG JPEG library source code
  24. #        is stored (at compilation time).
  25. #    JVERSION - the major version number of the IJG JPEG library.
  26. #    PSRCDIR, PVERSION - the same for libpng.
  27. #    ZSRCDIR - the same for zlib.
  28. #    SHARE_LIBPNG - normally 0; if set to 1, asks the linker to use
  29. #        an existing compiled libpng (-lpng) instead of compiling and
  30. #        linking libpng explicitly.
  31. #    SHARE_ZLIB - the same for zlib (-lgz).
  32. #    CONFIG - a configuration ID, added at the request of a customer,
  33. #        that is supposed to help in maintaining multiple variants in
  34. #        a single directory.  Normally this is an empty string;
  35. #        it may be any string that is legal as part of a file name.
  36. #    DEVICE_DEVS - the devices to include in the executable.
  37. #        See devs.mak for details.
  38. #    DEVICE_DEVS1...DEVICE_DEVS15 - additional devices, if the definition
  39. #        of DEVICE_DEVS doesn't fit on one line.  See devs.mak for details.
  40. #    FEATURE_DEVS - what features to include in the executable.
  41. #        Normally this is one of:
  42. #            level1 - a standard PostScript Level 1 language
  43. #            interpreter.
  44. #            level2 - a standard PostScript Level 2 language
  45. #            interpreter.
  46. #            pdf - a PDF-capable interpreter.
  47. #        You may include both level1 and pdf, or both level2 and pdf.
  48. #        The following feature may be added to either of the standard
  49. #        configurations:
  50. #            ccfonts - precompile fonts into C, and link them
  51. #            with the executable.  See fonts.txt for details.
  52. #        The remaining features are of interest primarily to developers
  53. #        who want to "mix and match" features to create custom
  54. #        configurations:
  55. #            dps - (partial) support for Display PostScript extensions:
  56. #            see language.txt for details.
  57. #            btoken - support for binary token encodings.
  58. #            Included automatically in the dps and level2 features.
  59. #            color - support for the Level 1 CMYK color extensions.
  60. #            Included automatically in the dps and level2 features.
  61. #            compfont - support for composite (type 0) fonts.
  62. #            Included automatically in the level2 feature.
  63. #            dct - support for DCTEncode/Decode filters.
  64. #            Included automatically in the level2 feature.
  65. #            filter - support for Level 2 filters (other than eexec,
  66. #            ASCIIHexEncode/Decode, NullEncode, PFBDecode,
  67. #            RunLengthEncode/Decode, and SubFileDecode, which are
  68. #            always included, and DCTEncode/Decode,
  69. #            which are separate).
  70. #            Included automatically in the level2 feature.
  71. #            fzlib - support for zlibEncode/Decode filters.
  72. #            ttfont - support for TrueType fonts.
  73. #            type1 - support for Type 1 fonts and eexec;
  74. #            normally included automatically in all configurations.
  75. #            type42 - support for Type 42 (embedded TrueType) fonts.
  76. #            Included automatically in the level2 feature.
  77. #        There are quite a number of other sub-features that can be
  78. #        selectively included in or excluded from a configuration,
  79. #        but the above are the ones that are most likely to be of
  80. #        interest.
  81. #    COMPILE_INITS - normally 0; if set to 1, compiles the PostScript
  82. #        language initialization files (gs_init.ps et al) into the
  83. #        executable, eliminating the need for these files to be present
  84. #        at run time.
  85. #    EXTEND_NAMES - a value N between 0 and 6, indicating that the name
  86. #        table should have a capacity of 2^(16+N) names.  This normally
  87. #        should be set to 0 (or left undefined), since non-zero values
  88. #        result in a larger fixed space overhead and slightly slower code.
  89. #        EXTEND_NAMES is ignored in 16-bit environments.
  90. #
  91. # It is very unlikely that anyone would want to edit the remaining
  92. #   symbols, but we describe them here for completeness:
  93. #    GS_INIT - the name of the initialization file for the interpreter,
  94. #        normally gs_init.ps.
  95. #    PLATFORM - a "device" name for the platform, so that platforms can
  96. #        add various kinds of resources like devices and features.
  97. #    CMD - the suffix for shell command files (e.g., null or .bat).
  98. #        (This is only needed in a few places.)
  99. #    D - the directory separator character (\ for MS-DOS, / for Unix).
  100. #    O - the string for specifying the output file from the C compiler
  101. #        (-o for MS-DOS, -o ./ for Unix).
  102. #    OBJ - the extension for relocatable object files (e.g., o or obj).
  103. #    XE - the extension for executable files (e.g., null or .exe).
  104. #    XEAUX - the extension for the executable files (e.g., null or .exe)
  105. #        for the utility programs (ansi2knr and those compiled with
  106. #        CCAUX).
  107. #    BEGINFILES - the list of files that `make begin' and `make clean'
  108. #        should delete.
  109. #    CCA2K - the C invocation for the ansi2knr program, which is the only
  110. #        one that doesn't use ANSI C syntax.  (It is only needed if
  111. #        the main C compiler also isn't an ANSI compiler.)
  112. #    CCAUX - the C invocation for auxiliary programs (echogs, genarch,
  113. #        genconf, geninit).
  114. #    CCBEGIN - the compilation command for `make begin', normally
  115. #        $(CCC) *.c.
  116. #    CCC - the C invocation for normal compilation.
  117. #    CCD - the C invocation for files that store into frame buffers or
  118. #        device registers.  Needed because some optimizing compilers
  119. #        will eliminate necessary stores.
  120. #    CCCF - the C invocation for compiled fonts and other large,
  121. #        self-contained data modules.  Needed because MS-DOS
  122. #        requires using the 'huge' memory model for these.
  123. #    CCINT - the C invocation for compiling the main interpreter module,
  124. #        normally the same as CCC: this is needed because the
  125. #        Borland compiler generates *worse* code for this module
  126. #        (but only this module) when optimization (-O) is turned on.
  127. #    CCLEAF - the C invocation for compiling modules that contain only
  128. #        leaf procedures, which don't need to build stack frames.
  129. #        This is needed only because many compilers aren't able to
  130. #        recognize leaf procedures on their own.
  131. #    AK - if source files must be converted from ANSI to K&R syntax,
  132. #        this is $(ANSI2KNR_XE); if not, it is null.
  133. #        If a particular platform requires other utility programs
  134. #        to be built, AK must include them too.
  135. #    SHP - the prefix for invoking a shell script in the current directory
  136. #        (null for MS-DOS, $(SH) ./ for Unix).
  137. #    EXPP, EXP - the prefix for invoking an executable program in the
  138. #        current directory (null for MS-DOS, ./ for Unix).
  139. #    SH - the shell for scripts (null on MS-DOS, sh on Unix).
  140. #    CONFILES - the arguments for genconf to generate the appropriate
  141. #        linker control files (various).
  142. #    CP_ - the command for copying one file to another.
  143. #    RM_ - the command for deleting (a) file(s) (including wild cards,
  144. #        but limited to a single file or pattern).
  145. #    RMN_ = the command for deleting multiple files / patterns.
  146. #
  147. # The platform-specific makefiles must also include rules for creating
  148. # certain dynamically generated files:
  149. #    gconfig_.h - this indicates the presence or absence of
  150. #        certain system header files that are located in different
  151. #        places on different systems.  (It could be generated by
  152. #        the GNU `configure' program.)
  153. #    gconfigv.h - this indicates the status of certain machine-
  154. #        and configuration-specific features derived from definitions
  155. #        in the platform-specific makefile.
  156.  
  157. # Define the name of this makefile.
  158. GS_MAK=makefile
  159.  
  160. # Define the names of the executables.
  161. GS_XE=$(GS)$(XE)
  162. ANSI2KNR_XE=ansi2knr$(XEAUX)
  163. ECHOGS_XE=echogs$(XEAUX)
  164. GENARCH_XE=genarch$(XEAUX)
  165. GENCONF_XE=genconf$(XEAUX)
  166. GENINIT_XE=geninit$(XEAUX)
  167.  
  168. # Define the names of the CONFIG-dependent header files.
  169. # gconfig*.h and gconfx*.h are generated dynamically.
  170. gconfig_h=gconfxx$(CONFIG).h
  171. gconfigf_h=gconfxc$(CONFIG).h
  172.  
  173. # Watcom make insists that rules have a non-empty body!
  174. all default: $(GS_XE)
  175.     $(RM_) _temp_*
  176.  
  177. distclean maintainer-clean realclean: clean
  178.     $(RM_) makefile
  179.  
  180. clean: mostlyclean
  181.     $(RM_) $(GS_XE)
  182.  
  183. mostlyclean:
  184.     $(RMN_) *.$(OBJ) *.a core gmon.out
  185.     $(RMN_) *.dev *.d_* arch.h devs*.tr gconfig*.h gconfx*.h j*.h o*.tr l*.tr
  186.     $(RMN_) gconfig*.c gscdefs*.c iconfig*.c
  187.     $(RMN_) _temp_* _temp_*.* *.map *.sym
  188.     $(RMN_) $(ANSI2KNR_XE) $(ECHOGS_XE) $(GENARCH_XE) $(GENCONF_XE) $(GENINIT_XE)
  189.     $(RMN_) gs_init.c $(BEGINFILES)
  190.  
  191. # Remove only configuration-dependent information.
  192. config-clean:
  193.     $(RMN_) *.dev devs*.tr gconfig*.h gconfx*.h o*.tr l*.tr
  194.  
  195. # A rule to do a quick and dirty compilation attempt when first installing
  196. # the interpreter.  Many of the compilations will fail:
  197. # follow this with 'make'.
  198.  
  199. begin:
  200.     $(RMN_) arch.h gconfig*.h gconfx*.h $(GENARCH_XE) $(GS_XE)
  201.     $(RMN_) gconfig*.c gscdefs*.c iconfig*.c
  202.     $(RMN_) gs_init.c $(BEGINFILES)
  203.     make arch.h gconfigv.h
  204.     - $(CCBEGIN)
  205.     $(RMN_) gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gscdefs.$(OBJ) gsmisc.$(OBJ)
  206.     $(RMN_) ccfontab.$(OBJ) iconfig.$(OBJ) iinit.$(OBJ) interp.$(OBJ)
  207.  
  208. # Auxiliary programs
  209.  
  210. arch.h: $(GENARCH_XE)
  211.     $(EXPP) $(EXP)genarch arch.h
  212.  
  213. # Macros for constructing the *.dev files that describe features and
  214. # devices.
  215. SETDEV=$(EXP)echogs -e .dev -w- -Q-dev -F -s -Q-obj
  216. SETPDEV=$(EXP)echogs -e .dev -w- -Q-dev -F -s -Q-include -Qpage -Q-obj
  217. SETMOD=$(EXP)echogs -e .dev -w- -Q-obj
  218. ADDMOD=$(EXP)echogs -e .dev -a-
  219.  
  220. ######################## How to define new 'features' #######################
  221. #
  222. # One defines new 'features' exactly like devices (see devs.mak for details).
  223. # For example, one would define a feature abc by adding the following to
  224. # gs.mak:
  225. #
  226. #    abc_=abc1.$(OBJ) ...
  227. #    abc.dev: $(GS_MAK) $(ECHOGS_XE) $(abc_)
  228. #        $(SETMOD) abc $(abc_)
  229. #        $(ADDMOD) abc -obj ... [if needed]
  230. #        $(ADDMOD) abc -oper ... [if appropriate]
  231. #        $(ADDMOD) abc -ps ... [if appropriate]
  232. #
  233. # If the abc feature requires the presence of some other features jkl and
  234. # pqr, then the rules must look like this:
  235. #
  236. #    abc_=abc1.$(OBJ) ...
  237. #    abc.dev: $(GS_MAK) $(ECHOGS_XE) $(abc_) jkl.dev pqr.dev
  238. #        $(SETMOD) abc $(abc_)
  239. #        ...
  240. #        $(ADDMOD) abc -include jkl pqr
  241.  
  242. # --------------------- Configuration-dependent files --------------------- #
  243.  
  244. # gconfig.h shouldn't have to depend on DEVS_ALL, but that would
  245. # involve rewriting gsconfig to only save the device name, not the
  246. # contents of the <device>.dev files.
  247. # FEATURE_DEVS must precede DEVICE_DEVS so that devices can override
  248. # features in obscure cases.
  249.  
  250. DEVS_ALL=$(PLATFORM).dev $(FEATURE_DEVS) \
  251.   $(DEVICE_DEVS) $(DEVICE_DEVS1) \
  252.   $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5) \
  253.   $(DEVICE_DEVS6) $(DEVICE_DEVS7) $(DEVICE_DEVS8) $(DEVICE_DEVS9) \
  254.   $(DEVICE_DEVS10) $(DEVICE_DEVS11) $(DEVICE_DEVS12) $(DEVICE_DEVS13) \
  255.   $(DEVICE_DEVS14) $(DEVICE_DEVS15)
  256.  
  257. devs_tr=devs.tr$(CONFIG)
  258. $(devs_tr): $(GS_MAK) $(MAKEFILE) $(ECHOGS_XE)
  259.     $(EXP)echogs -w $(devs_tr) - -include $(PLATFORM).dev
  260.     $(EXP)echogs -a $(devs_tr) - $(FEATURE_DEVS)
  261.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS)
  262.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS1)
  263.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS2)
  264.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS3)
  265.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS4)
  266.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS5)
  267.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS6)
  268.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS7)
  269.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS8)
  270.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS9)
  271.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS10)
  272.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS11)
  273.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS12)
  274.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS13)
  275.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS14)
  276.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS15)
  277.  
  278. # GCONFIG_EXTRAS can be set on the command line.
  279. # Note that it consists of arguments for echogs, i.e.,
  280. # it isn't just literal text.
  281.  
  282. ld_tr=ld$(CONFIG).tr
  283. $(gconfig_h) $(ld_tr) lib.tr: \
  284.   $(GS_MAK) $(MAKEFILE) $(GENCONF_XE) $(ECHOGS_XE) $(devs_tr) $(DEVS_ALL) libcore.dev
  285.     $(EXP)genconf $(devs_tr) libcore.dev -h $(gconfig_h) $(CONFILES)
  286.     $(EXP)echogs -a $(gconfig_h) -x 23 define GS_LIB_DEFAULT -x 2022 $(GS_LIB_DEFAULT) -x 22
  287.     $(EXP)echogs -a $(gconfig_h) -x 23 define GS_DOCDIR -x 2022 $(GS_DOCDIR) -x 22
  288.     $(EXP)echogs -a $(gconfig_h) -x 23 define GS_INIT -x 2022 $(GS_INIT) -x 22
  289.     $(EXP)echogs -a $(gconfig_h) $(GCONFIG_EXTRAS)
  290.  
  291. ################################################################
  292. # The other platform-independent makefiles are concatenated
  293. # (or included) after this one:
  294. #    lib.mak
  295. #    int.mak
  296. #    jpeg.mak
  297. #    libpng.mak
  298. #    zlib.mak
  299. #    devs.mak
  300. ################################################################
  301.